﻿using System;

namespace Modbus
{
	/// <summary>
	/// 
	/// </summary>
	public interface IModbusClientTransport : IDisposable
	{
		/// <summary>
		/// 
		/// </summary>
		/// <param name="slaveAddress"></param>
		/// <param name="message"></param>
		/// <exception cref="ArgumentNullException"></exception>
		/// <exception cref="ModbusException"></exception>
		void Request(byte slaveAddress, IModbusMessage message);

		/// <summary>
		/// 
		/// </summary>
		/// <typeparam name="TResponse"></typeparam>
		/// <param name="slaveAddress"></param>
		/// <param name="message"></param>
		/// <returns></returns>
		/// <exception cref="ArgumentException"></exception>
		/// <exception cref="ArgumentNullException"></exception>
		/// <exception cref="ModbusException"></exception>
		TResponse Request<TResponse>(byte slaveAddress, IModbusMessage message)
			where TResponse : IModbusMessage;
	}
}
